title: MySQL Update field of set IF NULL or other value
body: <p>I am currently using two update queries and am wondering if there is a way to cut it down to one.</p>
  
  <pre><code>field1 OFTYPE INT
  field2 OFTYPE DATETIME
  field3 OFTYPE DATETIME
  
  UPDATE `Table1` SET `field1` = `field1` + 1, `field2` = NOW() WHERE `id` = $id;
  UPDATE `Table1` SET `field3` = NOW() WHERE `id` = $id AND (`field3` &lt; '2011-00-00 00:00:00' OR `field3` IS NULL);
  </code></pre>
  
  <p>I'm trying to get a query that would do the UPDATE more like so:</p>
  
  <pre><code>UPDATE `Table1` 
  SET `field1` = `field1` + 1,
      `field2` = NOW(),
      `field3` = ISNULL(NOW(), `first_seen`);
  </code></pre>