Speeding up very slow UPDATE query (Postgresql 9.6)
You should create a B-tree index:

CREATE INDEX ON links_publicreply (direct_reply_id);


Note: your index links_publicreply_answer_to_id is useless and should be dropped.