SELECT 
  product_id 
FROM 
  cscart_product_popularity 
WHERE 
  product_id IN (
    40326, 40325, 40324, 40323, 40322, 40321, 
    40320, 31784, 27378, 31785, 42263, 
    42262
  )

Query time 0.00251

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "table": {
          "table_name": "cscart_product_popularity",
          "access_type": "range",
          "possible_keys": ["PRIMARY", "total"],
          "key": "PRIMARY",
          "key_length": "3",
          "used_key_parts": ["product_id"],
          "rows": 12,
          "filtered": 100,
          "attached_condition": "cscart_product_popularity.product_id in (40326,40325,40324,40323,40322,40321,40320,31784,27378,31785,42263,42262)",
          "using_index": true
        }
      }
    ]
  }
}

Result

product_id
27378
31784
31785
40320
40321
40322
40323
40324
40325
40326
42262
42263