The store isn’t closed until the store closes. That means, the doors are open to go shop.
Yes, you still can shop, even if it’s a few minutes before the store is closed.
The inventory inside still has value. The cashier might want to leave, but she’ll stay.
You don’t do anyone in the situation any favor by holding off. So if you need something, go ahead and buy.
It’s still good.