UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ggGUgD6kD0bQRdFc+HJ/9P7V4a4dyArl7lKhcxjIBzQ=' 
WHERE 
  key_id = '214a818d4a47a60e7b5c8bfedacbe1c1d898249eb9b6479eec320069ae9b36e4' 
  AND (
    token = 'ggGUgD6kD0bQRdFc+HJ/9P7V4a4dyArl7lKhcxjIBzQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023