You can greatly speed up your SQL queries by indexing your data, especially with large tables.
CREATE CLUSTERED INDEX index_name
ON [myDB].[dbo].[myTable] (value, cardID, locationID)
The command above creates a clustered index for your table. Place your actual column names within the round brackets. A clustered index sorts your rows in the order specified within the round brackets. You can create additional non-clustered indexes, but it is generally advisable to have at least one clustered index on your table.
If you have a unique identifier (e.g. an id for each observation that is truly distinct) in your data, you can create a UNIQUE INDEX by using the CREATE UNIQUE INDEX statement. This is generally the best way to speed up your queries.
Generally speaking, again, you should index your data in descending order of cardinality; this means that the columnn with most distinct values goes first in your "ON table (...)" statement, followed by columns with gradually fewer distinct values.