Yes play sand can get moldy if the play sand is allowed to get wet.
When your child is done playing in the sand box make sure to cover the sand box up with something to keep the rain out of the sand box.
My kids sand box has a cover that keeps both the rain and sun off the kids when they are playing in it.
Just kind of like a carport over the sand box that my husband built for them.
There is also a wooden cover that goes over the sand box that we just fold over that is on hinges.
Keeping the water out of the sand box should prevent mold in the play sand.
Since keeping a cover on the sand box we haven't had to change out the play sand in around 8 years.
When you use play sand in a sandbox they recommend that you change the play sand in the sand box every 1 to 2 years depending on how often your child or children plays in the sand box.
I personally however do not see much reason to change the sand in the sand box because even like regular sand on beaches it never gets changed and is very old.
To keep the play sand clean enough and prevent cats and other animals from pooping in it or urinating in it put a cover on the sand box.
The cover will keep the sand in the sand box sanitary and I never have changed the sand in my child's sand box and it's the same sand 8 years later.
I see no reason to really change out the sand because it's just sand and dirty already.