UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R8kkCF4bSzaC56JWOf19ZtCkiNHqlDABS3rRrLnJOGk=' 
WHERE 
  key_id = '3590e03206249cca53e815f7f17ef4898ccd840d4fa901b12f7bc7a15b238b5a' 
  AND (
    token = 'R8kkCF4bSzaC56JWOf19ZtCkiNHqlDABS3rRrLnJOGk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029