Spent a few hours trying to debug the query and understand why it keeps scanning the whole table after the result has been fetched.
The query calculates the running total and should stop execution as soon as the limit is reached or exceeded. [TotalSize] >= @maxBlobSize
WITH TopRows AS (
SELECT
[Id],
[BinaryData],
[CreatedAt],
Sum([BinaryDataSize]) OVER (ORDER BY [CreatedAt]) as TotalSize
FROM [dbo].[MessageLogs])
SELECT *
FROM TopRows
WHERE [TotalSize] < @maxBlobSize -- 10.000.000
ORDER BY [CreatedAt];