UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/+TvYG562M+Fz8WCtxpomR0k5eT7ZHuJwzVuOWOi2kc=' 
WHERE 
  key_id = '72afc740b5fb0f15a76e6cc3c470c6ade16a3087bec42d9c9e6aa127ac087c76' 
  AND (
    token = '/+TvYG562M+Fz8WCtxpomR0k5eT7ZHuJwzVuOWOi2kc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041