UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eR9dYEANkW7gpnyfO8vVfxxXts1YhHlRuoJZQNuRixc='
WHERE
key_id = 'fc7a250206a00789bb34c255072384582443fd3fdcc8f89e692a0c5d9bdeca3f'
AND (
token = 'eR9dYEANkW7gpnyfO8vVfxxXts1YhHlRuoJZQNuRixc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)