Geometric formulation of mechanical systems subjected to time-dependent one-sided constraints