WHERE
`status`='CONFIRMED' AND (
(
- `last_update` < (UNIX_TIMESTAMP() - {?profile_update?}) AND
+ (UNIX_TIMESTAMP() - `last_update`) >= {?profile_update?} AND
`last_update` > 0 AND
- `last_profile_sent` < (UNIX_TIMESTAMP() - {?resend_profile_update?})
+ (UNIX_TIMESTAMP() - `last_profile_sent`) >= {?resend_profile_update?}
) OR (
`last_update` = 0 AND
`last_profile_sent` = 0 AND
- `joined` < (UNIX_TIMESTAMP() - {?profile_update?})
+ (UNIX_TIMESTAMP() - `joined`) >= {?profile_update?}
)
)
ORDER BY