alphys wasn't there in the war so does the other pals (undyne, papyrus mettaton and sans, etc) except toriel and asgore since they're boss monsters, and boss monsters don't age as long as they doesn't have a child, don't say they have two, chara doesn't count as a monster child of theirs so their death won't affect their (Asgore and Toriel) aging, Asriel's death on the other hand, the reason behind Asgore and Toriel's good health and well-being, Gerson (the turtle guy) was Asgore's best friend and companion, he was there in the war and before it, making Asgore and Toriel and his age being more than a millennia (a thousand years) and that is being confirmed by Catty saying that they were trapped here for a millennium, the main characters (minus Asgore and Toriel) must age like normal humans unlike boss monsters (plus Gerson), so, to answer your question, Toriel locked herself in the ruins long before Alphys was even born.
HOW IS THAT FOR A 12 YEAR OLD GIRL?? *WISDOM INTENSIFIES*