Have several rows, or one single row with a huge comma separated data?
Use 1 row per ID, add an index on the ID. SQL is pretty good about finding a single value in a table, even if there are millions of rows. If you run periodic cleanup to wipe the old ID values out (like maybe have an automatic timestamp column and then have a job to drop all values older than X days), you wont run into any performance issues.

To give you an idea, in the production environment I work with, we have a similar table, about 40 columns wide, with some instances having >50 billion records, and pulling a single record out, queried by its unique, indexed ID, takes around 0.5s. Its very good hardware but its still pretty performant.