It should be something like this.
Code:
select xcart_orders.orderid from xcart_orders left join xcart_order_extras on xcart_orders.orderid = xcart_order_extras.orderid where xcart_order_extras.khash = 'ip' and xcart_order_extras.value = '24.245.16.66';