UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v3EoX3w06YxPX7UNWRU9/UhNB/GjjT0mTyXAUAEuBjg='
WHERE
key_id = 'fc418c24d51c0b3f6e34b70c3f0fb487a938aeea1eee697b8384734e08d2eb2f'
AND (
token = 'v3EoX3w06YxPX7UNWRU9/UhNB/GjjT0mTyXAUAEuBjg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)