Update blocks field programmatically if we use Layout?

The easiest way to create blocks and layouts looks like this:

$blocks = Kirby\Cms\Blocks::factory([
    [
        'content' => [
            'text' => 'Nice heading'
        ],
        'type' => 'heading'
    ],
    [
        'content' => [
            'text' => 'This is some text'
        ],
        'type' => 'text'
    ]
]);

$layouts = Kirby\Cms\Layouts::factory([
    [
        'columns' => [
            [
                'width' => '1/2',
                'blocks' => [
                    [
                        'content' => [
                            'text' => 'Nice heading'
                        ],
                        'type' => 'heading'
                    ]
                ]
            ],
            [
                'width' => '1/2',
                'blocks' => [
                    [
                        'content' => [
                            'text' => 'This is some text'
                        ],
                        'type' => 'text'
                    ]
                ]
            ]
        ],
    ]
]);