UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'INl1+GcWoQjsJ2x6LzLFBOrbpp3nxYKR0mbpZmT7Cj4='
WHERE
key_id = '74a8e8524e0127ce9ea42888c5561304e9515b6611bbfc42cfb85e6d735eb2bd'
AND (
token = 'INl1+GcWoQjsJ2x6LzLFBOrbpp3nxYKR0mbpZmT7Cj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)