title: ON DUPLICATE KEY UPDATE with WHERE
body: <p>I've got an <code>INSERT ... ON DUPLICATE KEY UPDATE</code> query and I am trying to add WHERE clause to it:</p>
  
  <pre><code>INSERT INTO `product_description` (
    `product_id`,`language_id`,`name`,
    `description`,`meta_description`,
    `meta_keyword`,`tag`
  ) VALUES (
    $getProductId, $languageId, '$pName', '$pDescription', '', '', ''
  )
  ON DUPLICATE KEY UPDATE
    `name` = '$pName',
    `description` = '$pDescription'
  </code></pre>
  
  <p>I want to restrict the <code>UPDATE</code> to those 2 conditions:</p>
  
  <pre><code>WHERE  `model` = 'specific-model' AND `sku` NOT LIKE '%B15%'
  </code></pre>
  
  <p>If I add this part of query to the end of the original query I get a MySQL syntax error. What would be a working solution?</p>
  
  <p><strong>Update</strong>: Please note that model and sku are in another table, and the common key is <code>product_id</code></p>