title: MYSQL to UPDATE table if row with 2 specific columns exist or INSERT new row if it does not exist
body: <p>I have a MYSQL table that looks as follows:</p>
  
  <pre><code>id    id_jugador    id_partido    team1     team2
  1        2              1           5         2
  2        2              2           1         1
  3        1              2           0         0
  </code></pre>
  
  <p>I need to create a query to either INSERT new rows in the table or UPDATE the table. The condition is based on <strong>id_jugador</strong> and <strong>id_partido</strong>, meaning that if I wanted to insert <code>id_jugador = 2</code> and <code>id_partido = 1</code>, then it should just UPDATE the existing row with the new team1 and team2 values I am sending. And dont duplicate the row.</p>
  
  <p>However, if I have an entry <strong>id_jugador=2</strong> and <strong>id_partido=3</strong>, since this combination does not exist yet, it should add the new row.</p>
  
  <p>I read about the REPLACE INTO but it seems to be unable to check combination of UNIQUE KEYS.</p>