<dtml-comment>
title:
connection_id:cmf_activity_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid:list
priority
date
retry
delay
processing_node
order_validation_text</params>
UPDATE
  message
SET
  processing = 0
<dtml-if priority>
  , priority = <dtml-sqlvar priority type="int">
</dtml-if>
<dtml-if delay>
  , date = DATE_ADD(UTC_TIMESTAMP(), INTERVAL <dtml-sqlvar delay type="int"> * (retry + 1) SECOND)
<dtml-elif date>
  , date = <dtml-sqlvar date type="datetime">
</dtml-if>
<dtml-if retry>
  , retry = retry + <dtml-sqlvar retry type="int">
</dtml-if>
WHERE
  1 = 1
<dtml-if uid>
  AND uid IN (
  <dtml-in uid><dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
  )
</dtml-if>
<dtml-if expr="_.getattr(_, 'processing_node', None) is not None">
  AND processing_node = <dtml-sqlvar processing_node type="int">
</dtml-if>
<dtml-if order_validation_text>
  AND order_validation_text = <dtml-sqlvar order_validation_text type="string">
</dtml-if>
