UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e++RvnJLY0Iw0038XqIVJjcIEjw6egpvmFG6gytTW4U=' 
WHERE 
  key_id = 'a03d04f735eec4d142426590089d411b68f036862dab588dc865c9db62c33d96' 
  AND (
    token = 'e++RvnJLY0Iw0038XqIVJjcIEjw6egpvmFG6gytTW4U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033