A few years ago I was on a walking trip in deepest mid Wales and walked down off the hills into a village for lunch. Unfortunately the pub I'd expected to eat at was closed, and the only other option was the post office shop, which was itself closed for lunch. Having waited around until it reopened, I went in and was pleased to find a lone cheese sandwich left on the shelf. Unfortunately when I took it to the counter, the lady serving said she couldn't sell it to me, as its sell-by date was the previous day.
I explained that I had no other options for food (there were no other shops within about five miles, and no public transport due for several hours), and that if I was at home, I'd have no qualms about eating cheese well over a day past its date. In the end she sold it to me at half price - I'm not sure how that satisfied any legal issues, but it seemed like a good outcome all round - I got my lunch and at half price, the shop got some income, and we avoided wasting food. It tasted absolutely fine

.