I just found out the painful way that if you manually update a column which is normally calculated automatically as an auto_increment it seems to work at first ..
but MySQL doesn't update the auto_increment value for the table - so subsequent inserts can fail.
The solution seems to be to delete and re-insert the row.
http://bugs.mysql.com/bug.php?id=12434
Test code:
mysql> create table test (id int(10) unsigned NOT NULL, col1 varchar(255), PRIMARY KEY (id));
Query OK, 0 rows affected (0.00 sec)
mysql> insert into test (col1) VALUES ('test1');