UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NMaubRyzC1RX2DYUZbjgZfkMB7rBGneoTG4qkvxCcQU='
WHERE
key_id = '64d782208f56cf6a651dff1eec192edff265116327e282b7b78b0cffc2894215'
AND (
token = 'NMaubRyzC1RX2DYUZbjgZfkMB7rBGneoTG4qkvxCcQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)