There is only one 40" 4k tv I know of which is the Panasonic GX800B, every other 4k tv comes in at 43" and above, any chance you could accommodate a 43"?
there is this model by samsung but its not android
Samsung UE40NU7120
https://ao.com/product/43pus7334-philips-the-one-tv-silver-68769-108.aspx
43" Philips 7334 £379
Only Android TV you are going to get for slightly over budget but it's a nice TV.
What I would do if I wanted to go cheaper would be buy a 43 inch Hisense for around £250 buy an Android box.
I have a Sony Bravia with Android it cost 1K+ and I have got a 4K firestick. The Firestick is 100000X faster than the offering in the Sony. Don't limit your self to Android built in. It's pants for a TV UI.