UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lQ3r1LFUKnkNXs+5jpyYsEZckLSofjm5AxzhwN0Uer0=' 
WHERE 
  key_id = 'd72d4e7f3bd9c1713c5a0a4b4dc7e80c6f30ad2f5be7bc2a6903aea844f99ba9' 
  AND (
    token = 'lQ3r1LFUKnkNXs+5jpyYsEZckLSofjm5AxzhwN0Uer0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020