UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h1JqrMIkp/S4bOgsQO+0ESkkGNbgDOzv72AfG8Mba4Y=' 
WHERE 
  key_id = 'ff76aaafc10994f5244b5eb6544a9f1eec2509ac79e76b6dd5149c08c1ea3e08' 
  AND (
    token = 'h1JqrMIkp/S4bOgsQO+0ESkkGNbgDOzv72AfG8Mba4Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031