the second picture is definetely not good to feed. It has gotten damp.
On the first one I can't tell if it has just fallen apart or if you have grain mites. They are horrible and can multiply fast.
So the solution is to keep the feed safely stored in a container that will keep out pests and most important keep it damp free.
Feed can go mouly very fast. Think how long bread lasts in your bread bin, it will go hard and stale quite quickly. The chicken feed can last longer but it suffers from the same aging effect bread does and bread goes moldy very easily. If the feed expereinces big temperature changes throughout the day it is more likely to experience condensation problems and mould so stable temps away from damp and protected from mice and mites.
Luckily you don't have that much wasted feed there. Get some more and find a better place to store it. I have resorted to keeping mine in a storage cupboard inside as it lasts much longer than out in the shed..