It just sets ` set_field_select('artefact', 'locked', 1, "locked = 0 AND id = ?", array($fileartefact->get('id'))); ` It needs to check if the lock is held first and wait till it isn't