There is really a very simple trick you can implement.
SELECT @razondecambio:=(MIN(id) - 1) FROM tabla; -- @razondecambio:=277
UPDATE tabla SET id=id-@razondecambio; -- 1er registro: id=(278-271)=1
SELECT @maximo:=MAX(id) FROM tabla;
ALTER TABLE tabla AUTO_INCREMENT = @maximo + 1;
You will notice that it is really a game:
queries as the lowest value of your self-increasing field.
you update each value taking into account the one obtained previously, any value above it runs the risk of being duplicated and given that as it is a primary key, this would be a problem.
queries which is the maximum current value of your new numbering.
you update your table counter with an increase over the current maximum.
I hope you find it very useful.