Check the swing brake release and the motor case drain first. On the 310L a worn swing motor shaft seal lets oil bypass internally — pull the case drain line into a bucket and measure flow at idle; a steady stream instead of a trickle points at the motor. Also make sure the swing lock pin isn't the only thing you've been trusting — the drift with no external leak is almost always internal bypass in the motor or a sticking counterbalance valve.
Hydraulics · 2016AnsweredExample
Backhoe swing drifts left when parked on a side slope
Boom slowly swings downhill on its own when the machine sits on a slope, engine off or idling. No external leaks at the swing motor or cylinders. Where's it bypassing?