UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OcdEQO6xRZN7bg+0cC6Twv/FaC1klpoEw6fyQ+zSYlM=' 
WHERE 
  key_id = '73ca56efff42a6401908e9b9ee0bb67b242582115e4d0cafe679c5df80b89bdd' 
  AND (
    token = 'OcdEQO6xRZN7bg+0cC6Twv/FaC1klpoEw6fyQ+zSYlM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024