SELECT 
  cscart_tags.tag_id, 
  cscart_tag_links.object_id, 
  cscart_tag_links.object_type, 
  cscart_tags.tag, 
  cscart_tags.status, 
  COUNT(cscart_tag_links.tag_id) as popularity 
FROM 
  cscart_tags 
  LEFT JOIN cscart_tag_links ON cscart_tag_links.tag_id = cscart_tags.tag_id 
WHERE 
  1 
  AND cscart_tag_links.object_type = 'P' 
  AND cscart_tags.status IN ('A') 
  AND cscart_tag_links.object_id = 138 
GROUP BY 
  cscart_tags.tag_id 
ORDER BY 
  cscart_tags.tag asc

Query time 0.00020

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost": 0.002862638,
    "filesort": {
      "sort_key": "cscart_tags.tag",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "cscart_tag_links",
              "access_type": "ref",
              "possible_keys": ["PRIMARY", "tag_id", "ids"],
              "key": "PRIMARY",
              "key_length": "6",
              "used_key_parts": ["object_type", "object_id"],
              "ref": ["const", "const"],
              "loops": 1,
              "rows": 1,
              "cost": 0.000928812,
              "filtered": 100,
              "attached_condition": "cscart_tag_links.object_type <=> 'P' and cscart_tag_links.object_id <=> 138 and cscart_tag_links.object_type = 'P'",
              "using_index": true
            }
          },
          {
            "table": {
              "table_name": "cscart_tags",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["tag_id"],
              "ref": ["cscart.cscart_tag_links.tag_id"],
              "loops": 1,
              "rows": 1,
              "cost": 0.001933826,
              "filtered": 100,
              "attached_condition": "cscart_tags.`status` = 'A'"
            }
          }
        ]
      }
    }
  }
}