Preheat the oven to 375°F (190°C).
In a large skillet, heat the olive oil over medium heat. Add the diced onion and garlic, cooking until softened, about 3-4 minutes.
Add the chopped mushrooms to the skillet and cook until they release their moisture and become tender, about 5-7 minutes.
Stir in the cooked lentils, chopped walnuts, thyme, rosemary, salt, pepper, soy sauce, and balsamic vinegar. Cook for an additional 2-3 minutes until everything is well combined. Remove from heat and let cool slightly.
Roll out the pie crust and fit it into a 9-inch tart pan. Trim any excess crust hanging over the edges.
Spoon the mushroom, lentil, and walnut mixture into the crust, spreading it evenly.
Brush the edges of the crust with the beaten egg for a golden finish.
Bake in the preheated oven for 30-35 minutes, or until the crust is golden brown.
Allow the tart to cool for 10 minutes before slicing. Garnish with fresh parsley if desired.