title: INSERT ... ON DUPLICATE KEY UPDATE with WHERE?
body: <p>I'm doing a <code>INSERT ... ON DUPLICATE KEY UPDATE</code> but I need the update part to be conditional, only doing the update if some extra condition has changed.</p>
  
  <p>However, <code>WHERE</code> is not allowed on this <code>UPDATE</code>. Is there any workaround for this?</p>
  
  <p>I can't do combinations of INSERT/UPDATE/SELECT since this needs to work over a replication.</p>