UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hm4fuVulnH+8IBC+gOJfYnjA0q7/7Wr4V9l85oHKy9A=' 
WHERE 
  key_id = '6d8ded73871a2b06c1ae8084339d349081e710e60e2332e86f01e258cf8afe98' 
  AND (
    token = 'Hm4fuVulnH+8IBC+gOJfYnjA0q7/7Wr4V9l85oHKy9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026