CREATE TEMPORARY TABLE tmp SELECT * FROM sitelog WHERE 1=1;
ALTER TABLE tmp DROP COLUMN `ID`;
INSERT INTO sitelog SELECT 0, tmp.* FROM tmp;
DROP TEMPORARY TABLE tmp;
CREATE TEMPORARY TABLE tmp SELECT * from invoices WHERE ...;
ALTER TABLE tmp drop ID; # drop autoincrement field
# UPDATE tmp SET ...; # just needed to change other unique keys
INSERT INTO invoices SELECT 0,tmp.* FROM tmp;
DROP TABLE tmp;