This query seems a little weird to me, though I don't know that this would explain it being slow. Why is it setting the person ID and comment ID in the ON CONFLICT DO UPDATE
clause, given that the clause's intent is to update the score for an existing person/comment pair? Similarly, why update the post ID in that case? Would upvoting a comment ever cause it to move to a different post if there was already an upvote?
I'd expect this to look more like
INSERT INTO "comment_like" ("person_id", "comment_id", "post_id", "score")
VALUES ($1, $2, $3, $4)
ON CONFLICT ("comment_id", "person_id") DO UPDATE
SET "score" = EXCLUDED.score
RETURNING "comment_like"."id", "comment_like"."person_id", "comment_like"."comment_id", "comment_like"."post_id", "comment_like"."score", "comment_like"."published"