From percona: https://bugs.launchpad.net/percona-server/+bug/1035225
Concurrent INSERT ... ON DUPLICATE KEY UPDATE statements on a table with
an AUTO_INCREMENT column may result in spurious duplicate key errors
(and, as a result, lost data due to some rows being updated rather than
inserted) with the default value of innodb_autoinc_lock_mode=1.
Tested on 5.5.27 but 5.3.8 is most probably affected too.