You have to use it by one week after the sell-by date imprinted on the baggie.

Seriously make sure it's in an airtight container, glass is best, that's not too much bigger than you need to fit it all in.
Keep it in the dark, in a cool place.
Your experience was probably unrelated to the fact that it was a month old.