1. Don't eat food if the expiration date has passed.

2. Don't eat food whose expiration date has passed.

3. Don't eat the food whose expiration date has passed.

4. Don't eat spoiled food whose expiration date has passed.
----------------------
Which ones are good to use?

So, 1 is ok to use because it says "the expiration date". Of course, that is a bit unclear because it doesn't necessarily say that the expiration date that it is talking about is on the food that it is talking about, so saying "Don't eat the food if the expiration date on it has passed" is much better. You can still use it, though, as it is grammatically correct.

Now, 2, 3, and 4 are all pretty much the same sentence, except 3 is more specific when it says "the food", and 4 just adds an adjective to the first sentence. That means that basically(and I may be wrong) if it is correct to say 'whose expiration date' then they will all be correct. If not, then they all won't. Think about it and read the sentences aloud to yourself.
Whose is mostly used for people and animals, but English doesn't have a version for objects. So, in this case, it is ok to use whose when referring to the food.
One thing you might consider changing in sentence 3 is that because it is saying the food, the rest of the sentence is just telling more about the food. It doesn't have to be included. So, you should probably add a comma between food and whose.
Sorry if this response was too long. Hope it helps!