MySQL query optimization.
===

I'm so bad in making good MySQL queries. I've created this one:

http://pastebin.com/GtDfgky8

`products` Table have about 17k rows,
`allegro` Table have about 3k of rows.

The query Idea is select all products, where stock_quanity > 3, where is photo, and where is no product id in `allegro` table.

Now query takes about 10 seconds...
I have no idea how I can optimize this query.

Please help my, I'll be thankfully! :)
& Sorry for my bad English also