A blowout preventer including, in certain aspects, a main body, a bonnet movably connected to the main body, the bonnet having a bonnet channel with interior threading, a ram shaft with a first portion extending through the main body and a second portion extending through the bonnet, the ram shaft having a ram shaft channel therein and an outer end, a ram connected to the ram shaft for selectively engaging a pipe, a locking assembly for selectively locking the ram shaft, the locking assembly including a torquing shaft with a portion within the ram shaft channel, the torquing shaft having an external end projecting beyond the bonnet, a locking shaft secured to the torquing shaft, the locking shaft having exterior threading for threadedly engaging the interior threading of the bonnet channel, and the locking shaft rotatable within the bonnet channel to abut the outer end of the ram shaft to releasably lock the ram shaft in position.