The pre save is not going to help you with atomicity.
// worker to get a job
Job.findOneAndUpdate(
{locked: false, $where: 'this.positionsopen < this.workersaccepted'}, // condition
{$set {locked: true}, $inc: { positionsopen: 1 }} // update
{new: true}, // options (new returns the modified version, false= orginal before update)
function(err, doc){
// do something
});
Job.findOneAndUpdate(
{locked: true, _id: '<job_id>'},
{$set: {locked: false}, $inc: { positionsopen: -1}},
{new: true},
function(err, doc){
});
Note: the $where condition is not ideal but would get the job done.