When a food enters into the Rotten stage, it will be lethal for the character to consume it. This happens after various periods of time depending on the food type and whether or not it was refrigerated. Non-perishable food cannot become rotten. After the electricity is out, there is no current way to preserve food other than creating soup or other meals, which can prolong the time before the food goes bad.
In previous builds you could create soup from rotten ingredients making it consumable, but this feature no longer exists (as of build 27+).