UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a0jHmr2++UTnZZfrdQIjdUYgGI+lfyFl14Q9uDKOtQc='
WHERE
key_id = '2f400c121836df71a45366d0c79f1bd2fbb45abea6042ff19c8b8fe498ff7340'
AND (
token = 'a0jHmr2++UTnZZfrdQIjdUYgGI+lfyFl14Q9uDKOtQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)