UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xvrWaJlU+walvQHp9aM4AsWnChxk7YLYLNk5MLtdqm0='
WHERE
key_id = '5395cb871f7374b73d2e14ceaa9d7d6953d8baff8bfa3b2e55aa119ca76d6839'
AND (
token = 'xvrWaJlU+walvQHp9aM4AsWnChxk7YLYLNk5MLtdqm0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)