UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '96WpBa6NEgrEynCklH/zxSrHOtYQMLEKLRlLCCBepWE='
WHERE
key_id = 'f866e5a7e82f7159a61ce357f8cf29dd4561e56c19d484b348d8c8677978decd'
AND (
token = '96WpBa6NEgrEynCklH/zxSrHOtYQMLEKLRlLCCBepWE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)