UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VTWDQ+0Z8bLeWSHvRZzRBpSibtVoFG8KXkQlr6gBsk0=' 
WHERE 
  key_id = 'e7388b515039e55fe7dfd9cc86467ff1a52e431f05ff14e05b3a4fa39eb52a39' 
  AND (
    token = 'VTWDQ+0Z8bLeWSHvRZzRBpSibtVoFG8KXkQlr6gBsk0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028