SELECT 
  o.user_id 
FROM 
  cscart_orders AS o 
  INNER JOIN cscart_order_details AS od ON o.order_id = od.order_id 
  AND od.product_id = 367 
WHERE 
  o.user_id IN ('') 
  AND o.status IN ('P', 'C')

Query time 0.00691

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "777.42"
    },
    "nested_loop": [
      {
        "table": {
          "table_name": "o",
          "access_type": "ref",
          "possible_keys": [
            "PRIMARY",
            "user_id",
            "status"
          ],
          "key": "user_id",
          "used_key_parts": [
            "user_id"
          ],
          "key_length": "3",
          "ref": [
            "const"
          ],
          "rows_examined_per_scan": 838,
          "rows_produced_per_join": 373,
          "filtered": "44.58",
          "cost_info": {
            "read_cost": "161.50",
            "eval_cost": "74.72",
            "prefix_cost": "329.10",
            "data_read_per_join": "3M"
          },
          "used_columns": [
            "order_id",
            "user_id",
            "status"
          ],
          "attached_condition": "(`eshopuga_upgr_4122`.`o`.`status` in ('P','C'))"
        }
      },
      {
        "table": {
          "table_name": "od",
          "access_type": "ref",
          "possible_keys": [
            "o_k"
          ],
          "key": "o_k",
          "used_key_parts": [
            "order_id",
            "product_id"
          ],
          "key_length": "6",
          "ref": [
            "eshopuga_upgr_4122.o.order_id",
            "const"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 373,
          "filtered": "100.00",
          "using_index": true,
          "cost_info": {
            "read_cost": "373.60",
            "eval_cost": "74.72",
            "prefix_cost": "777.42",
            "data_read_per_join": "84K"
          },
          "used_columns": [
            "order_id",
            "product_id"
          ]
        }
      }
    ]
  }
}