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