Preheat oven to 350 degrees F and line a standard loaf pan with parchment paper, for easy removal.
Heat a large pan over medium heat. Once hot, add the olive oil, onions, mushrooms and carrots. Cook, stirring frequently for about 5 minutes until the vegetables soften and the mushrooms release their juices. Remove from heat and set aside.
In a food processor, add the walnuts and pulse a few times. They should be in small pieces, but not completely a powder. Now add the lentils and pulse a few times. Dump the walnuts/lentils into a large bowl, and add the cooked vegetables, ground flaxseeds, ketchup, Worcestershire sauce, salt and dried thyme. Mix well with a wooden spoon. Now add 1/2 cup of the breadcrumbs and fold in. Add the last 1/4 cup if the mixture still seems wet, but if it's dry (this will depend on the moisture level of your lentils) don't add more. If the mixture is crumbly for some reason, add a few tablespoons of water.
Transfer to the prepared loaf pan, and press the mixture evenly and firmly into the pan. Cover with foil, and cook in the oven for 30 minutes.
Make the topping: Stir all topping ingredients in a small bowl to combine.
After 30 minutes, remove the foil, spread on the ketchup topping and cook uncovered for 10 more minutes. Let cool for about 15-20 minutes before slicing and serving. Enjoy!