Dried condensed milk
As @GdD said in a comment, it's probably better to just toss it. Although I will say that sweetened condensed milk actually lasts 2-3 weeks if refrigerated properly. After several months though, it's not worth the risk. In the future, you can store an extra half can in the freezer for 2-3 months without issue instead.
That said, sweetened condensed milk is actually just milk that's been reduced with sugar until it's quite thick. You can make a substitute at home by blending together fresh and powdered milk and sugar. I've seen multiple recipes, but have to admit I haven't tried it personally. So you might still be able to make your custard without a run to the store. Good luck!