Upon some further digging, it seems that this issue is different from the one in that thread and the bug report. Both those things deal with the following issue primarily:
https://stackoverflow.com/questions/3170634/how-to-solve-cannot-add-a-not-null-column-with-default-value-null-in-sqlite3
Which gives this error from the bug report:
ALTER TABLE oc_activity_mq ADD COLUMN amq_subjectparams CLOB NOT NULL
However, the issue I have I think is the following:
https://stackoverflow.com/questions/1814532/1071-specified-key-was-too-long-max-key-length-is-767-bytes
And my error is as stated above.
Additionally, the issue I have is with a different table than described in those posts. The solution proposed there is to drop the oc_activity_mq table and recreate it. My issue is in the oc_authtoken table, which I cannot very well drop.
After more searching, this particular issue was the one I was facing: https://github.com/nextcloud/server/issues/24222
However, somehow the solution there did not help me. I was however able to manually change parameters instead of config file using the following commands following the guidance in that post:
SET GLOBAL innodb_large_prefix = ON;
SET GLOBAL innodb_file_format = Barracuda;
SET GLOBAL innodb_file_per_table = ON;
Running occ upgrade after that worked!