They surpassed the previous record of 263-5, set by Royal Challengers Bangalore in 2013
Aleksei Miranchuk stunned the Juventus stadium by putting the visitors ahead after half an hour of the Group D match despite the home side having 70 percent of possession in the first half.
Lokomotiv's blanket defence frustrated the Serie A champions until Dybala equalised with an exquisite shot from outside the area in the 77th minute and the Argentine struck again three minutes later to complete a dramatic win.
Juventus stayed level with Atletico Madrid on seven points at the top of the group with Lokomotiv on three and Bayer Leverkusen still to get off the mark.