UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zs6VJRC/+kVr3xV/NYFfbBKkDL2lqlgcKQMR/t8tgN0=' 
WHERE 
  key_id = 'fd70442594903364ee00ca0e65279a96bdc1136cc40316bd850228fd789a34c9' 
  AND (
    token = 'zs6VJRC/+kVr3xV/NYFfbBKkDL2lqlgcKQMR/t8tgN0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041