Mechanical systems with singular and/or configuration-dependent mass matrix can pose difficulties to Hamiltonian formulations, which are the standard choice for the design of energy-momentum conserving time integrators. In this work, we derive a structure-preserving time integrator for constrained mechanical systems, based on a mixed variational approach. Livens’ principle (or sometimes called Hamilton-Pontryagin principle) features independent velocity and momentum quantities and circumvents the need to invert the mass matrix. In particular, we take up the description of rigid body rotations using unit quaternions. Using Livens’ principle, a new and comparatively easy approach to the simulation of these problems is presented. The equations of motion are approximated by using (partitioned) midpoint discrete gradients, thus generating a new energy-momentum conserving integration scheme for mechanical systems with singular and/or configuration-dependent mass matrix. The derived method is second-order accurate and algorithmically preserves a generalized energy function as well as the holonomic constraints and momentum maps corresponding to symmetries of the system. We study the numerical performance of the newly devised scheme in representative examples for multibody dynamics and rigid body rotations.