UPDATE bingo_cartones
SET numero = 0
WHERE (carton_id, numero) IN (
    SELECT carton_id, numero
    FROM (
        SELECT carton_id, numero,
            ROW_NUMBER() OVER (PARTITION BY carton_id ORDER BY id) AS rn
        FROM bingo_cartones
    ) AS subquery
    WHERE rn = 13
);
