Fresh milk purchased from my local Co-op often seems to go off before the 'use by' date on it but fresh milk purchased from most of the big supermarkets seems to last well beyond its 'use by' date, irrespective of whether it's been opened or not. For example, I can usually find fresh milk on Morrison's with a 'use by' date at least a week ahead of when I'm purchasing it and it will actually keep for at least 10 days, if not longer.
So I don't buy that much UHT milk but I do keep some as a reserve. The cuppa next to me on my desk right now is made with UHT milk. My problem with purchasing it though is that nearly all supermarkets have discontinued the 1 pint (or 500 ml) cartons. [It's got nothing to do with packaging supply problems though. The 1 pint/500ml cartons started disappearing from supermarket shelves a year or two ago].
Tesco's website shows long life milk only available in what you refer to as 'non-lidded' containers (except for sterilised milk), so it appears that's the packaging that they've decided to go with:
https://www.tesco.com/groceries/en-GB/shop/fresh-food/milk-butter-and-eggs/milk/long-life-milk
I buy my UHT milk in Morrison's, as they're one of the few stores that now stocks 1 pint (or 500ml) containers. It's particularly handy in my tiny little mini-fridge, as I need to lie milk containers on their side to get them in and the screw caps that Morrison's use don't leak when I do so:
https://groceries.morrisons.com/products/morrisons-long-life-british-semi-skimmed-milk-113599011