UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0XIU+sh/vnNCVSw+WWsarCSrZmfXYeRZ8HIR0Ad3Vjk='
WHERE
key_id = '17ad4b4ede838ad775707cd63065270f02e812164f8bf438defd50b1ac076cf0'
AND (
token = '0XIU+sh/vnNCVSw+WWsarCSrZmfXYeRZ8HIR0Ad3Vjk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)