<?php

$likes = $db->run("SELECT * FROM thumb");
foreach ( $likes as $like ) {
    $commentId = $db->cell("SELECT id FROM comment WHERE ssCommentId = ?", $like['commentId']);
    $db->update('thumb', ['commentId' => $commentId], ['id' => $like['id']]);
}