SELECT 
  COUNT(
    DISTINCT(cscart_order_details.order_id)
  ) as count, 
  cscart_orders.status as status 
FROM 
  cscart_orders 
  LEFT JOIN cscart_order_details ON cscart_order_details.order_id = cscart_orders.order_id 
WHERE 
  cscart_order_details.product_id = 367 
GROUP by 
  status

Query time 0.00520

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "4016.83"
    },
    "grouping_operation": {
      "using_filesort": true,
      "cost_info": {
        "sort_cost": "1616.00"
      },
      "nested_loop": [
        {
          "table": {
            "table_name": "cscart_orders",
            "access_type": "ALL",
            "possible_keys": [
              "PRIMARY",
              "status"
            ],
            "rows_examined_per_scan": 1616,
            "rows_produced_per_join": 1616,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "138.43",
              "eval_cost": "323.20",
              "prefix_cost": "461.63",
              "data_read_per_join": "16M"
            },
            "used_columns": [
              "order_id",
              "status"
            ]
          }
        },
        {
          "table": {
            "table_name": "cscart_order_details",
            "access_type": "ref",
            "possible_keys": [
              "o_k"
            ],
            "key": "o_k",
            "used_key_parts": [
              "order_id",
              "product_id"
            ],
            "key_length": "6",
            "ref": [
              "eshopuga_upgr_4122.cscart_orders.order_id",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 1616,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "1616.00",
              "eval_cost": "323.20",
              "prefix_cost": "2400.83",
              "data_read_per_join": "366K"
            },
            "used_columns": [
              "order_id",
              "product_id"
            ]
          }
        }
      ]
    }
  }
}