UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/X0JN9o+wXzqhJ99V2yUCNeH/Ay16+N/2GYVpXlgHOY='
WHERE
key_id = '72fb7329bb5185c9594af04e98c1c88bbb3e310c7418fc49034ef81c85be538b'
AND (
token = '/X0JN9o+wXzqhJ99V2yUCNeH/Ay16+N/2GYVpXlgHOY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)