title: On duplicate key update: existing value plus new value
body: <p>Is there a possibility to use a value from a column which shouldn't be updated for updating the value of another column? For example, something like this:</p>
  
  <p>Table: <code>product_id, color_id, amount, received</code></p>
  
  <p>Query:</p>
  
  <pre><code>INSERT INTO orders (product_id, color_id, amount)
  VALUES (100, 101, 5),(100,102,3)
  ON DUPLICATE KEY UPDATE
      product_id=values(product_id),
      color_id=values(color_id),
      amount=received+values(amount)
  </code></pre>
  
  <p>So, if there isn't an existing key a row will inserted with the amount value, but if there is a unique key the amount value is the value of the column received plus the amount value from the query.</p>