A South Carolina judge has upheld the 40-year prison sentence for a Cordova man who pleaded guilty to killing and mutilating his former girlfriend.