Update globals Matrix via a plugin
I do believe you're missing the handle to the top-level Matrix field when you're passing into setContentFromPost. You should be doing:

$couponCodeMatrix-&gt;setContentFromPost(array('couponCodes', $newMatrixData));

Otherwise, you're just passing:

'45623':
    'type': 'blockTypeHandle'
    'enabled': true,
    'fields': []


to the global set, instead of:

'couponCodes':
    '45623':
        'type': 'blockTypeHandle'
        'enabled': true,
        'fields': []


To deal with fetching even disabled blocks, you'll need to actually query the Matrix field's block directly, rather than looking just at the Global Sets content.

$criteria = craft()-&gt;elements-&gt;getCriteria(ElementType::MatrixBlock);
$criteria-&gt;fieldId = craft()-&gt;fields-&gt;getFieldByHandle('couponCodes')-&gt;id;
$criteria-&gt;ownerId = $couponCodeMatrix-&gt;id; // This is your Global Set id
$criteria-&gt;status = null;
$blocks = $criteria-&gt;find();

foreach($blocks as $block) { }


More complete code for anyone interested. We loop through the matrix and recreate it only if we updated the disabled status on the matching item. 

Thanks again!

    $couponCodeMatrix = craft()-&gt;globals-&gt;getSetByHandle('couponCodes');

    $criteria = craft()-&gt;elements-&gt;getCriteria(ElementType::MatrixBlock);
    $criteria-&gt;fieldId = craft()-&gt;fields-&gt;getFieldByHandle('couponCodes')-&gt;id;
    $criteria-&gt;ownerId = $couponCodeMatrix-&gt;id; // This is your Global Set id
    $criteria-&gt;status = null;
    $matrixBlocks = $criteria-&gt;find();

    $b_updateMatrix = false;
    $o_foundCoupon = false;
    $newMatrixData = array('couponCodes'=&gt;array());
    foreach($matrixBlocks as $block){

        $b_enabled = $block-&gt;enabled;
        if ($this-&gt;couponCheckMatch($s_code, $block)) {
            $o_foundCoupon = $block;
            if($block-&gt;singleUse==1){
                $b_updateMatrix=true;
                $b_enabled = false;
            }
        }

        $blockData = array(
            'type' =&gt; $block-&gt;getType()-&gt;handle,
            'enabled' =&gt; $b_enabled,
            'fields' =&gt; array(
                'couponCode' =&gt; $block-&gt;couponCode,
                'couponType' =&gt; $block-&gt;couponType,
                'couponValue' =&gt; $block-&gt;couponValue,
                'expiryDate' =&gt; $block-&gt;expiryDate,
                'singleUse' =&gt; $block-&gt;singleUse,
            )
        );
        $newMatrixData['couponCodes'][$block-&gt;id] = $blockData;
    }
    if($b_updateMatrix) {
        $couponCodeMatrix-&gt;setContentFromPost($newMatrixData);
        craft()-&gt;globals-&gt;saveContent($couponCodeMatrix);
    }