select * from indexation_server where `id` = "2" limit 1 SELECT `id` FROM `indexation_control` WHERE `type` = "1" and `status` = "1" and `list_id` = "2" LIMIT 1 INSERT INTO `indexation_control` (`type`, `list_id`, `server`, `action`, `status`, `start_time`, `last_action_ad`) VALUES ("1", "2", "index-ad","0", "1", "1500657395", "1500657395") select * from indexation_server where `id` = "2" limit 1 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657395 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657395 - 60)) and attempts < "1" and addition_time >= 1500657395 - 86400 and last_attempt <= 1500657395 - 5 order by addition_time DESC, id DESC limit 25 UPDATE img_download SET attempts = attempts + 1, last_attempt = "1500657395", status = "2", stream_id = "78", number_select = "0" WHERE `id` IN(56754,56753,56752,56751,56750,56749,56748,56747,56746,56745,56744,56743,56742,56741,56740,56739,56738,56737,56736,56735,56734,56733,56732,56731,56730) UPDATE `indexation_control` SET `img_check` = img_check + 25, `last_action_ad` = '1500657395' WHERE id = '78' LIMIT 1 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST SHOW PROCESSLIST SHOW PROCESSLIST SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657411 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657411 - 60)) and attempts < "1" and addition_time >= 1500657411 - 86400 and last_attempt <= 1500657411 - 5 order by addition_time DESC, id DESC limit 25 UPDATE img_download SET attempts = attempts + 1, last_attempt = "1500657411", status = "2", stream_id = "78", number_select = "1" WHERE `id` IN(56729,56728,56727,56726,56725,56724,56723,56722,56721,56720,56719,56718,56717,56716,56715,56714,56713,56712,56711,56710,56709,56708,56707,56706,56705) UPDATE `indexation_control` SET `img_check` = img_check + 25, `last_action_ad` = '1500657411' WHERE id = '78' LIMIT 1 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657412 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657412 - 60)) and attempts < "1" and addition_time >= 1500657412 - 86400 and last_attempt <= 1500657412 - 5 order by addition_time DESC, id DESC limit 25 UPDATE img_download SET attempts = attempts + 1, last_attempt = "1500657412", status = "2", stream_id = "78", number_select = "2" WHERE `id` IN(56704,56703,56702,56701,56700,56699,56698,56697,56696,56695,56694,56693,56692,56691,56690,56689,56688,56687,56686,56685,56684,56683,56682,56681,56680) UPDATE `indexation_control` SET `img_check` = img_check + 25, `last_action_ad` = '1500657412' WHERE id = '78' LIMIT 1 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657412 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657412 - 60)) and attempts < "1" and addition_time >= 1500657412 - 86400 and last_attempt <= 1500657412 - 5 order by addition_time DESC, id DESC limit 25 UPDATE img_download SET attempts = attempts + 1, last_attempt = "1500657412", status = "2", stream_id = "78", number_select = "3" WHERE `id` IN(56679,56678,56677,56676,56675,56674,56673,56672,56671,56670,56669,56668,56667,56666,56665,56664,56663,56662,56661,56660,56659,56658,56657,56656,56655) UPDATE `indexation_control` SET `img_check` = img_check + 25, `last_action_ad` = '1500657412' WHERE id = '78' LIMIT 1 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657413 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657413 - 60)) and attempts < "1" and addition_time >= 1500657413 - 86400 and last_attempt <= 1500657413 - 5 order by addition_time DESC, id DESC limit 25 UPDATE img_download SET attempts = attempts + 1, last_attempt = "1500657413", status = "2", stream_id = "78", number_select = "4" WHERE `id` IN(56654,56653,56652,56651,56650,56649,56648,56647,56646,56645,56644,56643,56642,56641,56640,56639,56638,56637,56636,56635,56634,56633,56632,56631,56630) UPDATE `indexation_control` SET `img_check` = img_check + 25, `last_action_ad` = '1500657413' WHERE id = '78' LIMIT 1 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657413 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657413 - 60)) and attempts < "1" and addition_time >= 1500657413 - 86400 and last_attempt <= 1500657413 - 5 order by addition_time DESC, id DESC limit 25 UPDATE img_download SET attempts = attempts + 1, last_attempt = "1500657413", status = "2", stream_id = "78", number_select = "5" WHERE `id` IN(56629,56628,56627,56626,56625,56624,56623,56622,56621,56620,56619,56618,56617,56616,56615,56614,56613,56612,56611,56610,56609,56608,56607,56606,56605) UPDATE `indexation_control` SET `img_check` = img_check + 25, `last_action_ad` = '1500657413' WHERE id = '78' LIMIT 1 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657413 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657413 - 60)) and attempts < "1" and addition_time >= 1500657413 - 86400 and last_attempt <= 1500657413 - 5 order by addition_time DESC, id DESC limit 25 UPDATE img_download SET attempts = attempts + 1, last_attempt = "1500657414", status = "2", stream_id = "78", number_select = "6" WHERE `id` IN(56604,56603,56602,56601,56600,56599,56598,56597,56596,56595,56594,56593,56592,56591,56590,56589,56588,56587,56586,56585,56584,56583,56582,56581,56580) UPDATE `indexation_control` SET `img_check` = img_check + 25, `last_action_ad` = '1500657414' WHERE id = '78' LIMIT 1 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657414 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657414 - 60)) and attempts < "1" and addition_time >= 1500657414 - 86400 and last_attempt <= 1500657414 - 5 order by addition_time DESC, id DESC limit 25 UPDATE img_download SET attempts = attempts + 1, last_attempt = "1500657414", status = "2", stream_id = "78", number_select = "7" WHERE `id` IN(56579,56578,56577,56576,56575,56574,56573,56572,56571,56570,56569,56568,56567,56566,56565,56564,56563,56562,56561,56560,56559,56558,56557,56556,56555) UPDATE `indexation_control` SET `img_check` = img_check + 25, `last_action_ad` = '1500657414' WHERE id = '78' LIMIT 1 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657414 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657414 - 60)) and attempts < "1" and addition_time >= 1500657414 - 86400 and last_attempt <= 1500657414 - 5 order by addition_time DESC, id DESC limit 25 UPDATE img_download SET attempts = attempts + 1, last_attempt = "1500657414", status = "2", stream_id = "78", number_select = "8" WHERE `id` IN(56554,56553,56552,56551,56550,56549,56548,56547,56546,56545,56544,56543,56542,56541,56540,56539,56538,56537,56536,56535,56534,56533,56532,56531,56530) UPDATE `indexation_control` SET `img_check` = img_check + 25, `last_action_ad` = '1500657414' WHERE id = '78' LIMIT 1 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657420 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657420 - 60)) and attempts < "1" and addition_time >= 1500657420 - 86400 and last_attempt <= 1500657420 - 5 order by addition_time DESC, id DESC limit 25 UPDATE img_download SET attempts = attempts + 1, last_attempt = "1500657420", status = "2", stream_id = "78", number_select = "9" WHERE `id` IN(56529,56528,56527,56526,56525,56524,56523,56522,56521,56520,56519,56518,56517,56516,56515,56514,56513,56512,56511,56510,56509,56508,56507,56506,56505) UPDATE `indexation_control` SET `img_check` = img_check + 25, `last_action_ad` = '1500657420' WHERE id = '78' LIMIT 1 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657427 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657427 - 60)) and attempts < "1" and addition_time >= 1500657427 - 86400 and last_attempt <= 1500657427 - 5 order by addition_time DESC, id DESC limit 25 UPDATE img_download SET attempts = attempts + 1, last_attempt = "1500657427", status = "2", stream_id = "78", number_select = "10" WHERE `id` IN(56504,56503,56502,56501,56500,56499,56498,56497,56496,56495,56494,56493,56492,56491,56490,56489,56488,56487,56486,56485,56484,56483,56482,56481,56480) UPDATE `indexation_control` SET `img_check` = img_check + 25, `last_action_ad` = '1500657427' WHERE id = '78' LIMIT 1 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 select * from indexation_server where `id` = "2" limit 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657438 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657438 - 60)) and attempts < "1" and addition_time >= 1500657438 - 86400 and last_attempt <= 1500657438 - 5 order by addition_time DESC, id DESC limit 25 UPDATE img_download SET attempts = attempts + 1, last_attempt = "1500657438", status = "2", stream_id = "78", number_select = "11" WHERE `id` IN(56479,56478,56477,56476,56475,56474,56473,56472,56471,56470,56469,56468,56467,56466,56465,56464,56463,56462,56461,56460,56459,56458,56457,56456,56455) UPDATE `indexation_control` SET `img_check` = img_check + 25, `last_action_ad` = '1500657438' WHERE id = '78' LIMIT 1 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657444 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657444 - 60)) and attempts < "1" and addition_time >= 1500657444 - 86400 and last_attempt <= 1500657444 - 5 order by addition_time DESC, id DESC limit 25 UPDATE img_download SET attempts = attempts + 1, last_attempt = "1500657444", status = "2", stream_id = "78", number_select = "12" WHERE `id` IN(56454,56453,56452,56451,56450,56449,56448,56447,56446,56445,56444,56443,56442,56441,56440,56439,56438,56437,56436,56435,56434,56433,56432,56431,56430) UPDATE `indexation_control` SET `img_check` = img_check + 25, `last_action_ad` = '1500657444' WHERE id = '78' LIMIT 1 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657444 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657444 - 60)) and attempts < "1" and addition_time >= 1500657444 - 86400 and last_attempt <= 1500657444 - 5 order by addition_time DESC, id DESC limit 25 UPDATE img_download SET attempts = attempts + 1, last_attempt = "1500657444", status = "2", stream_id = "78", number_select = "13" WHERE `id` IN(56429,56428) UPDATE `indexation_control` SET `img_check` = img_check + 2, `last_action_ad` = '1500657444' WHERE id = '78' LIMIT 1 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657444 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657444 - 60)) and attempts < "1" and addition_time >= 1500657444 - 86400 and last_attempt <= 1500657444 - 5 order by addition_time DESC, id DESC limit 25 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657449 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657449 - 60)) and attempts < "1" and addition_time >= 1500657449 - 86400 and last_attempt <= 1500657449 - 5 order by addition_time DESC, id DESC limit 25 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657454 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657454 - 60)) and attempts < "1" and addition_time >= 1500657454 - 86400 and last_attempt <= 1500657454 - 5 order by addition_time DESC, id DESC limit 25 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657459 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657459 - 60)) and attempts < "1" and addition_time >= 1500657459 - 86400 and last_attempt <= 1500657459 - 5 order by addition_time DESC, id DESC limit 25 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657464 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657464 - 60)) and attempts < "1" and addition_time >= 1500657464 - 86400 and last_attempt <= 1500657464 - 5 order by addition_time DESC, id DESC limit 25 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657469 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657469 - 60)) and attempts < "1" and addition_time >= 1500657469 - 86400 and last_attempt <= 1500657469 - 5 order by addition_time DESC, id DESC limit 25 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657474 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657474 - 60)) and attempts < "1" and addition_time >= 1500657474 - 86400 and last_attempt <= 1500657474 - 5 order by addition_time DESC, id DESC limit 25 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657479 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657479 - 60)) and attempts < "1" and addition_time >= 1500657479 - 86400 and last_attempt <= 1500657479 - 5 order by addition_time DESC, id DESC limit 25 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657484 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657484 - 60)) and attempts < "1" and addition_time >= 1500657484 - 86400 and last_attempt <= 1500657484 - 5 order by addition_time DESC, id DESC limit 25 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657489 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657489 - 60)) and attempts < "1" and addition_time >= 1500657489 - 86400 and last_attempt <= 1500657489 - 5 order by addition_time DESC, id DESC limit 25 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657494 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657494 - 60)) and attempts < "1" and addition_time >= 1500657494 - 86400 and last_attempt <= 1500657494 - 5 order by addition_time DESC, id DESC limit 25 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657499 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657499 - 60)) and attempts < "1" and addition_time >= 1500657499 - 86400 and last_attempt <= 1500657499 - 5 order by addition_time DESC, id DESC limit 25 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657504 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657504 - 60)) and attempts < "1" and addition_time >= 1500657504 - 86400 and last_attempt <= 1500657504 - 5 order by addition_time DESC, id DESC limit 25 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657509 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657509 - 60)) and attempts < "1" and addition_time >= 1500657509 - 86400 and last_attempt <= 1500657509 - 5 order by addition_time DESC, id DESC limit 25 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657514 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657514 - 60)) and attempts < "1" and addition_time >= 1500657514 - 86400 and last_attempt <= 1500657514 - 5 order by addition_time DESC, id DESC limit 25 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657519 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657519 - 60)) and attempts < "1" and addition_time >= 1500657519 - 86400 and last_attempt <= 1500657519 - 5 order by addition_time DESC, id DESC limit 25 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657524 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657524 - 60)) and attempts < "1" and addition_time >= 1500657524 - 86400 and last_attempt <= 1500657524 - 5 order by addition_time DESC, id DESC limit 25 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 SHOW PROCESSLIST select count(id) from img_download where status = "2" and last_attempt > 1500657529 - 60 and stream_id = "78" SELECT `id`, `url`, `ad`, `source_name`, `crop_img`, `height_img`, `name` FROM `img_download` where (status = "0" or (status = "2" and last_attempt < 1500657529 - 60)) and attempts < "1" and addition_time >= 1500657529 - 86400 and last_attempt <= 1500657529 - 5 order by addition_time DESC, id DESC limit 25 SELECT action FROM indexation_control WHERE id = "78" and status = "1" LIMIT 1 UPDATE indexation_control SET `status` = '0', last_action_ad = '1500657534' WHERE id = '78' and status = '1' LIMIT 1