UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1XFJj+frDz8B6h3p2G3HLJaqM/7GAC8Fzjs8KrpWqrY=' 
WHERE 
  key_id = '67d121b256b2b8d453ace8ff6ada0955bb8e8bc4ef67f6f97e64eef8678f5bf2' 
  AND (
    token = '1XFJj+frDz8B6h3p2G3HLJaqM/7GAC8Fzjs8KrpWqrY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041