Combine the lentils, vegetable stock, and a generous pinch of salt in a large sauce pan. Bring to a boil, reduce heat, and let simmer for 30 minutes. Drain.
As lentils cook, create salmon packet by cutting two large, equal sized pieces of foil. Place them on top of each other. Drizzle olive oil on foil, about the size of your salmon fillet (or about 1-2 Tablespoons). Place the salmon on top of oil; drizzle about 1-2 teaspoons olive oil and the juice of a lemon on top of salmon. Salt and pepper. Top with lemon slices and 3-4 fresh thyme sprigs. Fold together the long ends of the foil and loosely roll the smaller ends up. Bake for 22-25 minutes (be careful not to overcook).
Heat oil and butter in large saute pan. Add onions and stir to coat. Let cook for 8-10 minutes, only stirring once or twice to allow them to caramelize. Add garlic, thyme, and red pepper flakes (if using). Add mushrooms, stir to coat, and let cook in pan for an additional 8-10 minutes to caramelize until tender. Salt and pepper to taste.
Cut the salmon into portions (if cooked as a whole fillet) and plate by stacking lentils, mushroom and onion mixture, and the salmon. Serve with additional lemon slices and fresh thyme.