added insert_or_update method to implement the mysql ON DUPLICATE KEY
stuff