title: mysql update if some values exists otherwise create a new entry
body: <p>I have a table <code>rating</code> with these fields <code>rate_id, game_id, rating, ip</code>. Let suppose that these fields has the following values <code>1,130,5,155.77.66.55</code> </p>
  
  <p>When a user try to vote for a game, I want with mysql to check if he has already vote for this game so mysql will check if <code>ip</code> and <code>game_id</code> already exists, if they exists then mysql will update the value of <code>rating</code> otherwise will create a new entry.</p>
  
  <p>What is a efficient way to do this?</p>