UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'StEVc7qqUhQjCs7ydox8duhvkceV2Jfpq6rYxh/GT24=' 
WHERE 
  key_id = 'cbf8f60fcdec7cec5c77b71c041d72ff3ff58711ca08d500b09875ddf55bd673' 
  AND (
    token = 'StEVc7qqUhQjCs7ydox8duhvkceV2Jfpq6rYxh/GT24=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018