UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PMktOD3HaVoZCARezUQWlQNjOXGRH3LzIPGqD8yFEmo=' 
WHERE 
  key_id = '4618d9c6ae50f378c4d9ed223ccb104c3ba2923c980fab425c0ceff2b37bfdb8' 
  AND (
    token = 'PMktOD3HaVoZCARezUQWlQNjOXGRH3LzIPGqD8yFEmo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035