UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NmSqWbvitrmJMt4QgtfYVxinaBvlKsa9+t2G9k7aQCg='
WHERE
key_id = '34bd4722458da89d0b07ebd08c865b951fa83428a0cd8038682bb03631473a11'
AND (
token = 'NmSqWbvitrmJMt4QgtfYVxinaBvlKsa9+t2G9k7aQCg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)