正确的方式应该是使用 last_insert_id() 函数:
update mytable set count=last_insert_id(counter+1);select last_insert_id();