UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xYgl5ft8LQx4e8D3XqcRYx3FoIyalZzqXHWIlc95IMQ='
WHERE
key_id = '110aa48911d30727e03d5cb091743e2dcaa498901b28ddcec534ae14ca0e156a'
AND (
token = 'xYgl5ft8LQx4e8D3XqcRYx3FoIyalZzqXHWIlc95IMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)