UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VCJzKVRoEMemONUy6v/quAyHkZwPjp5BtfJu4cMcmLE=' 
WHERE 
  key_id = 'bc6243bcf998daef393258ecfa34ab7193b50f87fa908f6a5eb4aa046c144744' 
  AND (
    token = 'VCJzKVRoEMemONUy6v/quAyHkZwPjp5BtfJu4cMcmLE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022