TOKEN_LOCKED
while ((r = tokendb_lockrec(user, &tr, TOKEN_LOCKED)) == 1) {
tr.flags &= ~TOKEN_LOCKED;
if ((tokenrec->flags & TOKEN_LOCKED)||(tokenrec->flags & recflags)) {
switch (tokendb_lockrec(username, &tokenrec, TOKEN_LOCKED)) {
tokenrec.flags &= ~TOKEN_LOCKED;
switch (tokendb_lockrec(username, &tokenrec, TOKEN_LOCKED)) {
tokenrec.flags &= ~TOKEN_LOCKED;
tokenrec.flags &= ~TOKEN_LOCKED;