Set a timer and work for 20 minutes at a time. Take a 5 minute break (set a timer for that too!) to stretch, snack, drink etc... then right back to it. Every time you wander off, start the timer over. (I usually find myself going to great lengths to avoid things I don't want to do!)
You could also create a 20 minute playlist instead, I know that helps me time my workouts.
Good luck!