E' prevista una sintassi apposita per insert.

INSERT ... ON DUPLICATE KEY UPDATE

http://dev.mysql.com/doc/refman/5.0/en/insert.html