UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rVxZ4YV9jV5lM647M1IYCnhdLGV62XuocIm/jeuLS14='
WHERE
key_id = '6bbefef9b38394fc17f65c43a10f0d1afc53661424d38765c0449e87f691ee9a'
AND (
token = 'rVxZ4YV9jV5lM647M1IYCnhdLGV62XuocIm/jeuLS14='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)