UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HZzo1FyFUmw3cQg7bTH9CjM7IYfqaG2/HyZZKJvgSxI=' 
WHERE 
  key_id = 'dc5f331cd3f45210061788a6e0efd9bc518249569be0b09410f099cf1c76203d' 
  AND (
    token = 'HZzo1FyFUmw3cQg7bTH9CjM7IYfqaG2/HyZZKJvgSxI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037