UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3Pj1BTdwawLeRFUpXkFN1Lv09C4BEDlX7HPbvRiKg3I=' 
WHERE 
  key_id = 'db2374d3d05743e93396b355c5496d35a11d26cf236bf54a35fbb7dbcb5e0d1e' 
  AND (
    token = '3Pj1BTdwawLeRFUpXkFN1Lv09C4BEDlX7HPbvRiKg3I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029