UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W4FRU8Xxc1z7ak3pfJAIMwLD+dkL05d7SbiGBFUoM1s=' 
WHERE 
  key_id = '859ffd8625818d4b4b4eadba8f8b05d804f0a92217b67847f356cd2b2d480e8b' 
  AND (
    token = 'W4FRU8Xxc1z7ak3pfJAIMwLD+dkL05d7SbiGBFUoM1s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020