You can issue an INSERT ON DUPLICATE KEY UPDATE SQL Syntax. This way if it cannot insert a record, it will instead update it.
I'd suggest as well that a surrogate auto increment is not needed. Since I'd assume each of the 9100 records is already unique, using the actual code as the primary key would be sufficient.
header('HTTP/1.1 420 Enhance Your Calm');