http://blog.saltfactory.net/mysql/insert-into-on-duplicate-key-update-on-mysql.html


INSERT INTO students (NAME, email) VALUES ('saltfactory', 'saltfactory@gmail.com')
ON DUPLICATE KEY UPDATE name='saltfactory', email='saltfactory@me.com';