UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kQHesu4qwomYNMRFfeb/pBhQOD01cy36uTqXfr6ds4U=' 
WHERE 
  key_id = 'eacc59260722faf6fe935db7208ef2d7cf76b4c0bc1c24d48c0124b71a79c91e' 
  AND (
    token = 'kQHesu4qwomYNMRFfeb/pBhQOD01cy36uTqXfr6ds4U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025