SELECT 
  cscart_discussion.thread_id 
FROM 
  cscart_product_variation_group_products as pvgp 
  LEFT JOIN cscart_discussion ON cscart_discussion.object_id = pvgp.product_id 
WHERE 
  (
    pvgp.parent_product_id = 19499 
    OR pvgp.product_id = 19499
  ) 
  AND cscart_discussion.object_type = 'P'

Query time 0.00036

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "table": {
          "table_name": "pvgp",
          "access_type": "index_merge",
          "possible_keys": ["PRIMARY", "idx_parent_product_id"],
          "key_length": "3,3",
          "index_merge": {
            "sort_union": [
              {
                "range": {
                  "key": "idx_parent_product_id",
                  "used_key_parts": ["parent_product_id"]
                }
              },
              {
                "range": {
                  "key": "PRIMARY",
                  "used_key_parts": ["product_id"]
                }
              }
            ]
          },
          "rows": 2,
          "filtered": 100,
          "attached_condition": "pvgp.parent_product_id = 19499 or pvgp.product_id = 19499"
        }
      },
      {
        "table": {
          "table_name": "cscart_discussion",
          "access_type": "ref",
          "possible_keys": ["object_id"],
          "key": "object_id",
          "key_length": "6",
          "used_key_parts": ["object_id", "object_type"],
          "ref": ["lillyshop_lillyshop.pvgp.product_id", "const"],
          "rows": 1,
          "filtered": 100,
          "index_condition": "cscart_discussion.object_type = 'P'"
        }
      }
    ]
  }
}

Result

thread_id
20458