There are absolutely two phones to consider if one has a price range around 40k but right now both these phones are not at their very best prices. I'll explain it below.
1. Pixel 7a: It's a good phone with absolute best cameras out there, great software support in terms of updates (though there are bugs that get introduced every now and then with updates but usually Google does listen if reported by masses). This time they chose to go for a heavier build at 193g. Other than that the negatives include the Tensor G2 chipset which runs warm and if you are keen on using camera for prolonged times, be ready to get disappointed. Other one is mediocre battery life. The phone is currently going for 40k (with card offer). If you can wait for some time it's gonna come down like it happened with pixel 6a.
2. Nothing Phone 1: It's an all balanced phone with smooth software (with each update tend to improve upon user experience and they listen to feedback well), good battery life, absolutely gorgeous display. The cameras aren't to the level of Pixels but they're great and are not far behind. Improvements are being made with each update and since the phone was launched the phone has gone through massive amounts of improvements. It's best price would be around 25k for 128GB variant which it was a few months back but right now it's going for 30k so if you're not in a hurry wait till the Nothing Phone 2 is launched this month. Also, you can go with Nothing Phone 2 if it launches at that price point of 40k.