Preheat the oven to 350°F. In a large heavy saucepan melt the butter with the five-spice powder, the cayenne, the thyme, and salt to taste, stirring, add the walnuts, and toss them to coat them well. Bake the walnuts in batches in a shallow baking pan in the middle of the oven for 10 minutes and let them cool until they are warm.